<!doctype html>
<html xmlns:shiro="http://www.pollix.at/thymeleaf/shiro" xmlns:th="http://www.springframework.org/schema/data/jaxb" class="x-admin-sm">
<head>
	<meta charset="UTF-8">
	<title>后台-首页</title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<link rel="icon" type="image/x-icon" href="/static/img/favicon.ico">
	
	<!-- jQuery  -->
    <script type="text/javascript" src="/static/plugins/jquery/jquery-1.10.2.min.js"></script>
	
	<link rel="stylesheet" href="/static/admin/css/font.css">
	<link rel="stylesheet" href="/static/admin/css/xadmin.css">
	
	<!-- layui  -->
	<script src="/static/plugins/layui/2.5.4/layui.js" charset="utf-8"></script>
	<script type="text/javascript" src="/static/admin/js/xadmin.js"></script>
</head>
<body class="index">
	<!-- 顶部开始 -->
	<div class="container">

		<dd th:each="menu : ${dto.menuLeftArr}">
			<ul class="layui-nav left" lay-filter="">
				<li class="layui-nav-item">
					<a href="javascript:;"><span style="font-size: 16px;">[[${menu.name}]]</span></a>
					<dl class="layui-nav-child">
						<!-- 二级菜单 -->
						<div style="color: black;" th:each="sub : ${menu.subArr}">
							<div style="padding: 5px 10px; font-size: 18px;">[[${sub.name}]]</div>
							<hr style="margin: 0;">
							<div class="layui-fluid" style="font-size: 12px; width: 400px; ">
								<div class="layui-row">
									<div class="layui-col-sm3" th:each="module : ${sub.moduleArr}">
										<span style="margin: 15px; cursor: pointer;" th:onclick="xadmin.add_tab([[${module.name}]], [[${module.linkTo}]])">[[${module.name}]]</span>
									</div>
								</div>
							</div>
						</div>
					</dl>
				</li>
			</ul>
		</dd>

		<dd>
			<ul class="layui-nav left" lay-filter="">
				<li class="layui-nav-item">
					<a href="javascript:;"><span style="font-size: 16px;">admin/管理员</span></a>
					<dl class="layui-nav-child">
						<!-- 二级菜单 -->
						<dd><a onclick="xadmin.open('修改密码页面','/toUpdPwd',600,400)">修改密码</a></dd>
					</dl>
					<dl class="layui-nav-child">
						<!-- 二级菜单 -->
						<dd><a onclick="javascript:void(0);">切换部门</a></dd>
						<dd><a onclick="/logout">退出</a></dd>
					</dl>
				</li>
			</ul>
		</dd>

		<dd>
			<ul class="layui-nav left" lay-filter="">
				<li class="layui-nav-item "><a href="javascript:void(0);" title="任务中心" onclick="xadmin.add_tab('任务中心', '/web/flow/ysp/toIndex')"><span><i class="layui-icon layui-icon-list" style="font-size: 20px;"></i><span class="layui-badge" th:if="${dto.numTaskNeedHandle != 0}">[[${dto.numTaskNeedHandle}]]</span></span></a></li>
			</ul>
		</dd>

		<dd>
			<ul class="layui-nav left" lay-filter="">
				<li class="layui-nav-item "><a href="javascript:void(0);" title="邮件系统" onclick="xadmin.add_tab('邮件系统', '/web/mail/toIndex')"><span><i class="layui-icon layui-icon-email" style="font-size: 20px;"></i><span class="layui-badge">1</span></span></a></li>
			</ul>
		</dd>
	</div>
	<!-- 顶部结束 -->
	<!-- 中部开始 -->
	<!-- 底部主体[start] -->
	<div class="page-content">
		<div class="layui-tab tab" lay-filter="xbs_tab" lay-allowclose="false">
			<ul class="layui-tab-title">
				<li class="home"><i class="layui-icon">&#xe68e;</i>我的桌面</li>
			</ul>
			<div class="layui-unselect layui-form-select layui-form-selected" id="tab_right">
				<dl>
					<dd data-type="this">关闭当前</dd>
					<dd data-type="other">关闭其它</dd>
					<dd data-type="all">关闭全部</dd>
				</dl>
			</div>
			<div class="layui-tab-content">
				<div class="layui-tab-item layui-show">
					<iframe src='/dashboard' frameborder="0" scrolling="yes" class="x-iframe"></iframe>
				</div>
			</div>
			<div id="tab_show"></div>
		</div>
	</div>
	<!-- 底部主体[end] -->
	<script type="text/javascript">
	$(function() {
		
		// 各个iframe的高度
		var moduleId = '';
		$(".layui-nav-item").each(function(cnt,dom){
			var val = $(this).attr("data-model-id");
			if(val==moduleId){
				$(this).addClass("layui-this");
			}
		});
	});
	
	function doSwitchOrg(orgId) {
		$.ajax({
			type: "POST",
			url: '/api/inter/tsOrganizationInfo/switchOrg',
			data: {
				orgId: orgId
			},
			success: function (data) {
				if (data.code == 0) {
					window.location.reload();
				} else {
					alert(data.msg);
				}
			}
		});
	}
	
	function doSwitchOperateCompany(id) {
		$.ajax({
			type: "POST",
			url: '/api/inter/thrOperateCompanyApply/switchOperateCompany',
			data: {
				id: id
			},
			success: function (data) {
				if (data.code == 0) {
					window.location.reload();
				} else {
					alert(data.msg);
				}
			}
		});
	}
	</script>
	
    <script th:inline="javascript">
    	// var serverUrl = [[${#httpServletRequest.getServerName() + ":" + #httpServletRequest.getServerPort()}]];
		var basePath = [[${dto.userInfo.basePath}]];
		console.log('basePath---', basePath);
		var userid = [[${dto.userInfo.userId}]];
		var username = [[${dto.userInfo.userName}]];
		var websocktPre = [[${dto.userInfo.websocktPre}]];
    </script>
	<script th:if="${dto.userInfo.userId == 'admin'}" type="application/javascript" src="/static/admin/index/layuiim.js"></script>
    <script th:if="${dto.userInfo.userId != 'admin'}" type="application/javascript" src="/static/admin/index/layuiim2.js"></script>
</body>

</html>